package com.gallop.akka;



import java.util.function.Consumer;


public interface ActorEnhance {

    org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(ActorEnhance.class);

    default <P> void invokeSafe(Consumer<P> consumer, P message) {
        try {
            consumer.accept(message);
        } catch (Exception e) {
            log.error("error caught in actor.", e);
        }
    }
}
